home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / ada / gnat1792.zip / gnat179b / t-adainc / s-tastal.adb < prev    next >
Text File  |  1994-05-19  |  3KB  |  70 lines

  1. -----------------------------------------------------------------------------
  2. --                                                                         --
  3. --                GNU ADA RUNTIME LIBRARY (GNARL) COMPONENTS               --
  4. --                                                                         --
  5. --       S Y S T E M . T A S K _ S T O R A G E _ A L L O C A T I O N       --
  6. --                                                                         --
  7. --                                 B o d y                                 --
  8. --                                                                         --
  9. --                            $Revision: 1.3 $                             --
  10. --                                                                         --
  11. --          Copyright (c) 1991,1992,1993, FSU, All Rights Reserved         --
  12. --                                                                         --
  13. -- GNARL is free software; you can redistribute it and/or modify it  under --
  14. -- terms  of  the  GNU  Library General Public License as published by the --
  15. -- Free Software Foundation; either version 2, or  (at  your  option)  any --
  16. -- later  version.   GNARL is distributed in the hope that it will be use- --
  17. -- ful, but but WITHOUT ANY WARRANTY; without even the implied warranty of --
  18. -- MERCHANTABILITY  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Gen- --
  19. -- eral Library Public License for more details.  You should have received --
  20. -- a  copy of the GNU Library General Public License along with GNARL; see --
  21. -- file COPYING. If not, write to the Free Software Foundation,  675  Mass --
  22. -- Ave, Cambridge, MA 02139, USA.                                          --
  23. --                                                                         --
  24. -----------------------------------------------------------------------------
  25.  
  26. with System.Storage_Elements;
  27.  
  28. with System.Task_Memory;
  29.  
  30. package body System.Task_Storage_Allocation is
  31.  
  32.    --------------------
  33.    -- Allocate_Block --
  34.    --------------------
  35.  
  36.    --  Note: the Alignment parameter is ignored here, since Low_Level_New
  37.    --  is guaranteed to return a block of the maximum possible alignment.
  38.  
  39.    procedure Allocate_Block
  40.      (Storage_Address : out System.Address;
  41.       Storage_Size    : Storage_Elements.Storage_Count;
  42.       Alignment       : in Storage_Elements.Storage_Count)
  43.    is
  44.    begin
  45.       Storage_Address := Task_Memory.Low_Level_New (Storage_Size);
  46.    end Allocate_Block;
  47.  
  48.    ----------------------
  49.    -- Deallocate_Block --
  50.    ----------------------
  51.  
  52.    procedure Deallocate_Block (Storage_Address : System.Address) is
  53.    begin
  54.       Task_Memory.Low_Level_Free (Storage_Address);
  55.    end Deallocate_Block;
  56.  
  57.    ---------------------
  58.    -- Maximum_Storage --
  59.    ---------------------
  60.  
  61.    --  Returns zero, indicating no fixed limit, since there is no fixed
  62.    --  (determinable) limit on the memory available on a POSIX system.
  63.  
  64.    function Maximum_Storage return Storage_Elements.Storage_Count is
  65.    begin
  66.       return 0;
  67.    end Maximum_Storage;
  68.  
  69. end System.Task_Storage_Allocation;
  70.